package com.icode.core.model.user;

import com.icode.core.model.AbstractEntity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-11-12
 * Time: 上午11:09
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "address")
public class Address extends AbstractEntity {


    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;
    private String username;
    private String phoneNum;
    @ManyToOne
    @JoinColumn(name = "province_id")
    private Province province;
    @ManyToOne
    @JoinColumn(name = "city_id")
    private City city;
    @ManyToOne
    @JoinColumn(name = "district_id")
    private District district;
    private String area;

    public Address() {
    }

    public Address(User user, String username, String phoneNum, Province province, City city, District district, String area) {
        this.user = user;
        this.username = username;
        this.phoneNum = phoneNum;
        this.province = province;
        this.city = city;
        this.district = district;
        this.area = area;
    }

    public User user() {
        return user;
    }

    public String username() {
        return username;
    }

    public String phoneNum() {
        return phoneNum;
    }

    public Province province() {
        return province;
    }

    public City city() {
        return city;
    }

    public District district() {
        return district;
    }

    public String area() {
        return area;
    }
}
